
# scope.fig-- changes values of scopeb and scopef for display updater to use
# Copyright (C) 2021 mn
#
# This program is free software: you can redistribute it and/or modify 
#
# it under the terms of the GNU Affero General Public License as published by 
# the Free Software Foundation, either version 3 of the License, or 
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License 
# along with this program. If not, see <http://www.gnu.org/licenses/>.

function vget g k
python
    return g[k]
    fig
    fig

function vset g k v
python
    g[k] = v
    return g
    fig
    fig

function scope buf params
    gt  vget params "token"
    try
        bs  gt  ltrim  rtrim  split bs " "  left 1   mid 1 1  val
        bf  gt  ltrim  rtrim  split bf " "  right 1  mid 1 1  val
    except
        bs  -1
        bf  -1
        fig
    now vset params "scopeb" bs  vset params "scopef" bf
    params now  return params
    fig

